VERSION 5.00
Begin VB.Form frmUsers 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "frmUsers"
   ClientHeight    =   3015
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4680
   Icon            =   "frmUsers.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3015
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Height          =   375
      Left            =   2040
      TabIndex        =   3
      Top             =   2520
      Width           =   1215
   End
   Begin VB.CommandButton cmdSend 
      Default         =   -1  'True
      Height          =   375
      Left            =   3360
      TabIndex        =   2
      Top             =   2520
      Width           =   1215
   End
   Begin VB.ListBox lstUserList 
      Height          =   2010
      Left            =   120
      Sorted          =   -1  'True
      TabIndex        =   1
      Top             =   360
      Width           =   4455
   End
   Begin VB.Label lblUsers 
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   3255
   End
End
Attribute VB_Name = "frmUsers"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim WithEvents IRCLink As clsModIRC
Attribute IRCLink.VB_VarHelpID = -1
Public FormMode As Integer

Private Sub cmdCancel_Click()
Unload Me
End Sub

Private Sub cmdOther_Click()
Dim nm As String

nm = InputBox("Input nickname", "Other Nickname...")
  Unload Me

End Sub

Private Sub cmdSend_Click()
Dim DNick As String

DNick = GetWord(lstUserList.List(lstUserList.ListIndex), 1)
  frmMain.IRCInterface.SendCTCP DNick, "PAGER", frmMain.txtInput.Text
  frmMain.AddToHistory "Page to " + DNick + ": " + frmMain.txtInput.Text, True
  frmMain.txtInput.Text = ""
  frmMain.txtInput.SetFocus
  Unload Me
End Sub

Private Sub Form_Load()
Set IRCLink = frmMain.IRCInterface

lstUserList.Clear
lstUserList.AddItem "Populating list..."

IRCLink.RequestWho

End Sub

Sub FormSet()
    
    Me.Caption = lang.Messages(46)
lblUsers.Caption = lang.Messages(14)
cmdSend.Caption = lang.Buttons(13)
cmdCancel.Caption = lang.Buttons(3)

    End Sub

Private Sub IRCLink_WhoList(UserList() As String)
Dim c As Long
Dim ChannelListString As String
Dim ig As Long

lstUserList.Clear

For c = 1 To UBound(UserList)

  ChannelListString = GetWord(UserList(c), 5)
  If FormMode <> 2 Then ChannelListString = ChannelListString & " " + GetWord(UserList(c), 1)
  If InStr(GetWord(ChannelListString, 1), "Serv") > 0 Then GoTo GoNext
  If Right(GetWord(ChannelListString, 1), 3) = "Bot" Then GoTo GoNext
  If Left(GetWord(ChannelListString, 1), 5) = "Guest" Then GoTo GoNext
  For ig = 1 To WordCount(Settings.KnownIgnores)
    If LCase(GetWord(Settings.KnownIgnores, ig)) = LCase(GetWord(ChannelListString, 1)) Then GoTo GoNext
  Next
    
  lstUserList.AddItem ChannelListString

GoNext:
Next

lblUsers.Caption = "Online Users (" + Trim(Str(lstUserList.ListCount)) + " users online)"

End Sub
Private Sub Form_Unload(Cancel As Integer)
  Set IRCLink = Nothing
End Sub

